//
//  DaoHangView.m
//  TravelYo
//
//  Created by lanou3g on 15/10/29.
//  Copyright © 2015年 TravelYo. All rights reserved.
//

#import "DaoHangView.h"

@interface DaoHangView ()


@property (nonatomic, assign) CGFloat selfWidth;

@property (nonatomic, assign) CGFloat selfHeight;

@end



@implementation DaoHangView

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _selfWidth = frame.size.width;
        _selfHeight = frame.size.height;
        [self addSubViews];
    }
    return self;
}


- (void)addSubViews
{
    NSArray *array = @[@"全部", @"机票", @"酒店", @"自由", @"签证", @"游轮"];
    for (int i = 0; i < 6; i++) {
        UIButton *button = [UIButton buttonWithType:(UIButtonTypeCustom)];
        [button setTitle:array[i] forState:(UIControlStateNormal)];
        button.frame = CGRectMake((_selfWidth / 6) * i, 0, _selfWidth / 6, _selfHeight);
        button.layer.cornerRadius = 20;
        button.layer.masksToBounds = YES;
        button.tag = 10 + i;
        [button setTitleColor:kMainColor forState:(UIControlStateNormal)];
        [self addSubview:button];
    }
    _allBT = (UIButton *)[self viewWithTag:10];
    _jipiaoBT = (UIButton *)[self viewWithTag:11];
    _jiudianBT = (UIButton *)[self viewWithTag:12];
    _ziyouBT = (UIButton *)[self viewWithTag:13];
    _qianzhengBT = (UIButton *)[self viewWithTag:14];
    _youlunBT = (UIButton *)[self viewWithTag:15];
    
}







/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

@end
